package com.kfh.ybracelet.my;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.kfh.ybracelet.R;
import com.kfh.ybracelet.base.BaseActivity;
import com.kfh.ybracelet.utils.Constant;


/**
 * 关于
 * Created by Administrator on 2015/8/13.
 */
public class AboutActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        mApplication.addActivity(this);
        setContentView(R.layout.activity_about);

        initWidget();

    }

    private void initWidget() {
        ImageView iv_left = (ImageView) findViewById(R.id.iv_left);
        TextView tv_title = (TextView) findViewById(R.id.tv_title);

        tv_title.setText("关于我们");

        iv_left.setOnClickListener(this);

        WebView wv_about = (WebView) findViewById(R.id.wv_about);
        MyWebViewClient client = new MyWebViewClient();

        wv_about.setWebViewClient(client);
        wv_about.loadUrl(Constant.HOST);

    }
    private class MyWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    }
    @Override
    public void widgetClick(View v) {
        switch (v.getId()) {
            case R.id.iv_left:
                finish();
                break;
        }
    }
}
